All files / packages/tools/src/synchronizers/callbacks areViewportsCoplanar .ts

0% Statements 0/6
100% Branches 0/0
0% Functions 0/1
0% Lines 0/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13                         
import { vec3 } from 'gl-matrix';
import { Types } from '@cornerstonejs/core';
 
export default function areViewportsCoplanar(
  viewport1: Types.IStackViewport,
  viewport2: Types.IStackViewport
): boolean {
  const { viewPlaneNormal: viewPlaneNormal1 } = viewport1.getCamera();
  const { viewPlaneNormal: viewPlaneNormal2 } = viewport2.getCamera();
  const dotProducts = vec3.dot(viewPlaneNormal1, viewPlaneNormal2);
  return Math.abs(dotProducts) > 0.9;
}